package com.hnkywl.jip.service;

import com.hnkywl.jip.dao.SubjectDao;
import com.hnkywl.jip.utils.SubjectData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 说明：
 * 包:        com.hnkywl.jip.service
 * 类描述:    [一句话描述该类的功能]
 * 创建人:    ZHUCHG
 * 创建时间: 13-3-2 下午4:37
 * 修改人:    ZHUCHG
 * 修改时间: 13-3-2 下午4:37
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Service
public class SubjectService {
    private SubjectDao subjectDao;

    @Transactional
    public List findCommonSubject(Integer companyId) {
        return subjectDao.findCommonSubject(companyId);
    }

    @Transactional
    public void saveSubjectCode(List<SubjectData> data) {
        subjectDao.deleteSubjectCode(data);
        subjectDao.saveSubjectCode(data);
    }

    @Autowired
    public void setSubjectDao(SubjectDao subjectDao) {
        this.subjectDao = subjectDao;
    }
}
